<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>

    //1.if
    var count=3;
    if (count == 3) {
        document.write(count);
    }


    //2.switch
/*   var count=9;
   switch (count) {
       case 1:{
           document.write("星期一");;
           break;
       }case 2:{
           document.write("星期二");;
           break;
       }case 3:{
           document.write("星期三");;
           break;
       }case 4:{
           document.write("星期四");;
           break;
       }case 5:{
           document.write("星期五");;
           break;
       }case 6:{
           document.write("星期六");;
           break;
       }case 7:{
           document.write("星期日");;
           break;
       }
       default :{
           document.write("输入的星期有误")
           break;
       }
   }*/


    //3.for
  /*  var sum=0;
    for (let i=1;i <= 100;i++){
       sum +=i;
   }
    alert(sum);*/

  //4.while
   /* var sum=0;
    var i=1;
    while (i <=100) {
        sum+=i;
        i++;
    }
    alert(sum);*/

  //5.do...while
    var sum=0;
    var i=1;
    do {
        sum+=i;
        i++;
    }while (i <= 100);
    alert(sum)





</script>
</body>
</html>